package com.github.fuse.handler;

import com.github.fuse.annotation.Default;
import com.github.fuse.entity.AopExecute;

import java.lang.annotation.Annotation;

/**
 * @author: wangdejun
 * @create: 2019-10-24 14:24
 **/
public class DefaultFuseHandler extends AbstractFuseHandler<Default> {
    @Override
    public Class<? extends Annotation> getType() {
        return Default.class;
    }

    @Override
    public Object doHandler(AopExecute aopExecute, Default aDefault) throws Throwable {
        // 不执行任何操作
        return aopExecute.getJoinPoint().proceed(aopExecute.getParams());
    }

    @Override
    public Object fuseMethod(Throwable e, AopExecute aopExecute, Default aDefault) throws Throwable {
        throw e;
    }
}
